/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.datav.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.datav.entity.DataScreenCategory;
import com.jeeplus.modules.datav.mapper.DataScreenCategoryMapper;

/**
 * 大屏分类Service
 * @author 刘高峰
 * @version 2021-03-29
 */
@Service
@Transactional(readOnly = true)
public class DataScreenCategoryService extends TreeService<DataScreenCategoryMapper, DataScreenCategory> {

	public DataScreenCategory get(String id) {
		return super.get(id);
	}

	public List<DataScreenCategory> findList(DataScreenCategory dataScreenCategory) {
		if (StringUtils.isNotBlank(dataScreenCategory.getParentIds())){
			dataScreenCategory.setParentIds(","+dataScreenCategory.getParentIds()+",");
		}
		return super.findList(dataScreenCategory);
	}

	@Transactional(readOnly = false)
	public void save(DataScreenCategory dataScreenCategory) {
		super.save(dataScreenCategory);
	}

	@Transactional(readOnly = false)
	public void delete(DataScreenCategory dataScreenCategory) {
		super.delete(dataScreenCategory);
	}

}